'\" te
.\"  Copyright 1989 AT&T  Copyright (c) 2001, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH ELF32_CHECKSUM 3ELF "Jul 11, 2001"
.SH NAME
elf32_checksum, elf64_checksum \- return checksum of elf image
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ]
#include <libelf.h>

\fBlong\fR \fBelf32_checksum\fR(\fBElf *\fR\fIelf\fR);
.fi

.LP
.nf
\fBlong\fR \fBelf64_checksum\fR(\fBElf *\fR\fIelf\fR);
.fi

.SH DESCRIPTION
.LP
The \fBelf32_checksum()\fR function returns a simple checksum of selected
sections of the image identified by \fIelf\fR. The value is typically used as
the \fB\&.dynamic\fR tag \fBDT_CHECKSUM\fR, recorded in dynamic executables and
shared objects.
.sp
.LP
Selected sections of the image are used to calculate the checksum in order that
its value is not affected by utilities such as \fBstrip\fR(1).
.sp
.LP
For the 64\(mibit class, replace 32 with 64 as appropriate.
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Stable
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.LP
.BR elf (3ELF),
.BR elf_version (3ELF),
.BR gelf (3ELF),
.BR libelf (3LIB),
.BR attributes (7)
